/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package BL;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author sundas
 */
@Embeddable
public class StockproductPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "stockId", nullable = false)
    private int stockId;
    @Basic(optional = false)
    @Column(name = "productNumber", nullable = false)
    private int productNumber;

    public StockproductPK() {
    }

    public StockproductPK(int stockId, int productNumber) {
        this.stockId = stockId;
        this.productNumber = productNumber;
    }

    public int getStockId() {
        return stockId;
    }

    public void setStockId(int stockId) {
        this.stockId = stockId;
    }

    public int getProductNumber() {
        return productNumber;
    }

    public void setProductNumber(int productNumber) {
        this.productNumber = productNumber;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) stockId;
        hash += (int) productNumber;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof StockproductPK)) {
            return false;
        }
        StockproductPK other = (StockproductPK) object;
        if (this.stockId != other.stockId) {
            return false;
        }
        if (this.productNumber != other.productNumber) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "DB.StockproductPK[stockId=" + stockId + ", productNumber=" + productNumber + "]";
    }

}
